package com.euond.accv.mdm.domain;

import java.util.*;
import java.math.BigDecimal;
import javax.persistence.*;
import java.io.Serializable;

import org.hibernate.annotations.DynamicInsert;
import com.alibaba.fastjson.annotation.JSONField;
import com.euond.common.domain.AbstractEntity;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;


@Entity
@Table(name = "bas_category")
@DynamicInsert //该注解会根据属性非空动态生成insert语句
public class BasCategory extends AbstractEntity<Integer> implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 类别ID
     */
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    /**
     * 客户编号 默认C0001 浙江联华
     */
    @Column(name = "customer_no")
    private String customerNo;

    /**
     * 类别编号
     */
    @Column(name = "category_no")
    private String categoryNo;

    /**
     * 类别名称
     */
    @Column(name = "category_name")
    private String categoryName;

    /**
     *
     */
    @Column(name = "order_no")
    private Integer orderNo;

    /**
     *
     */
    @Column(name = "enable_flag")
    private Integer enableFlag;

    /**
     * 确认状态(0=未确认 1=已确认 )
     */
    @Column(name = "confirm_flag")
    private Integer confirmFlag;

    /**
     *
     */
    @Column(name = "remarks")
    private String remarks;

    /**
     *
     */
    @Column(name = "creator")
    private String creator;

    /**
     *
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_time")
    private Date createTime;

    /**
     *
     */
    @Column(name = "modifier")
    private String modifier;

    /**
     *
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "modify_time")
    private Date modifyTime;

    /**
     *
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "update_time")
    private Date updateTime;

    @NotFound(action = NotFoundAction.IGNORE)
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "customer_no", referencedColumnName = "customer_no", insertable = false, updatable = false)
    private MdmCustomer mdmCustomer;

    public MdmCustomer getMdmCustomer() {
        return mdmCustomer;
    }

    public void setMdmCustomer(MdmCustomer mdmCustomer) {
        this.mdmCustomer = mdmCustomer;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCustomerNo() {
        return this.customerNo;
    }

    public void setCustomerNo(String customerNo) {
        this.customerNo = customerNo;
    }

    public String getCategoryNo() {
        return this.categoryNo;
    }

    public void setCategoryNo(String categoryNo) {
        this.categoryNo = categoryNo;
    }

    public String getCategoryName() {
        return this.categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Integer getOrderNo() {
        return this.orderNo;
    }

    public void setOrderNo(Integer orderNo) {
        this.orderNo = orderNo;
    }

    public Integer getEnableFlag() {
        return this.enableFlag;
    }

    public void setEnableFlag(Integer enableFlag) {
        this.enableFlag = enableFlag;
    }

    public Integer getConfirmFlag() {
        return this.confirmFlag;
    }

    public void setConfirmFlag(Integer confirmFlag) {
        this.confirmFlag = confirmFlag;
    }

    public String getRemarks() {
        return this.remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getCreator() {
        return this.creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getModifier() {
        return this.modifier;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier;
    }

    public Date getModifyTime() {
        return this.modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public Integer getId() {
        // TODO Auto-generated method stub
        return this.id;
    }
}
